/*! \file Primitive.h
 *	\brief <write description for Primitive.h>
 *
 *	created:	2009/11/17
 *	created:	17:11:2009   14:20
 *	filename: 	o:\main\libs\gd\Primitive.h
 *	file path:	o:\main\libs\gd
 *	file base:	Primitive
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _GD_PRIMITIVE_H_
#define _GD_PRIMITIVE_H_

#pragma once

#include <core/noncopyable.h>
#include <core/SmartPtr.h>
#include <core/types.h>

namespace tt{
namespace gd{

class DeviceContext;
class IndexBuffer;
class VertexBuffer;

class Primitive : NonCopyable
{
public:
	Primitive(void);
	virtual ~Primitive(void);

	void setBuffers(const SharedPtr<IndexBuffer>&, const SharedPtr<VertexBuffer>&);

	void apply(DeviceContext*);

protected:
	SharedPtr<IndexBuffer>& indexBuffer();

protected:
	virtual void onApply(DeviceContext*) = 0;

private:
	SharedPtr<IndexBuffer> m_indexBuffer;
	SharedPtr<VertexBuffer> m_vertexBuffer;
};

} //namespace gd
} //namespace tt
#include "Primitive.inl"

#endif //_GD_PRIMITIVE_H_
